package me.fanchaoo.web.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.fanchaoo.dbo.TagDBO;
import me.fanchaoo.web.dto.LoginUserDTO;
import me.fanchaoo.web.dto.MomentDTO;
import me.fanchaoo.web.request.AddTagRequest;
import me.fanchaoo.web.request.QueryTagRequest;
import me.fanchaoo.web.response.BaseResponse;
import me.fanchaoo.web.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

@Api(description = "标签")
@RestController
@RequestMapping("/tag")
public class TagController {

    @Autowired
    private TagService tagService;

    @ApiOperation(value = "添加标签")
    @PostMapping(value = "/addTag")
    public BaseResponse<TagDBO> addTag(@Valid @RequestBody AddTagRequest request) {

        return tagService.addTag(request);

    }
    @ApiOperation(value = "查询标签")
    @PostMapping(value = "/queryTag")
    public BaseResponse<List<TagDBO>> addTag(@Valid @RequestBody QueryTagRequest request) {

        return tagService.queryTag(request);

    }



}
